import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import installElementPlus from './plugins/element'
// 导入全局样式表
import './assets/css/global.css'
// 导入字体图标
import './assets/fonts/iconfont.css'

import axios from 'axios'
// 创建 axios 实例
const axiosInstance = axios.create({
  baseURL: 'http://localhost:8010', // 请求的基础路径
  timeout: 10000, // 请求超时时间
  headers: { // 默认请求头
    'Content-Type': 'application/json'
  }
})

const app = createApp(App)
installElementPlus(app)
// 挂载到 Vue 原型，方便全局调用
app.config.globalProperties.$axios = axiosInstance
app.use(router).mount('#app')
